#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    //创建按钮，关联到handle槽函数
    QPushButton* button = new QPushButton(this);
    button->setText("按钮");
    button->move(100,100);
    connect(button,&QPushButton::clicked,this,&Widget::handle);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handle()
{
    //输出不带window frame的QRect
    qDebug() << this->geometry();
    //输出带上window frame的QRect
    qDebug() << this->frameGeometry();
}

